﻿using SMCL.Core.Utils.Types.Json;

namespace SMCL.Core.Utils.Types
{
    public enum Type { Release, Snapshot, Old };
    public class Version(VersionManifest_Version versionManifest_Version)
    {
        public string Name => versionManifest_Version.Id;
        public Type Type => versionManifest_Version.Type switch
        {
            "release" => Type.Release,
            "snapshot" => Type.Snapshot,
            "old_beta" => Type.Old,
            "old_alpha" => Type.Old,
            _ => throw new ArgumentException("未知的版本类型")
        };
        public Uri Url => versionManifest_Version.Url;
        public DateTime UpdateTime => versionManifest_Version.Time;
        public DateTime ReleaseTime => versionManifest_Version.ReleaseTime;
    }
}
